#include<iostream>
#include<sys/types.h>
#include<unistd.h>
using namespace std;
int main()
{
	pid_t pid=fork();
	int val=100;
	if(pid==0){
		while(1){
            cout<<"我是子进程 "<<getpid()<<"   val==="<<val<<endl;
			sleep(1);
    	}
	}
	else{
		while(1){
			cout<<"我是父进程  "<<pid<<"  val==="<<val<<endl;
			val++;
			sleep(1);
		}
	}
	return 0;
}
